﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YasharEl.Infrastructure.EntityModel;
using YasharEl.Infrastructure.Core.Prototype;

namespace YasharEl.Infrastructure.ProcessEngine.EntityModel
{
    public class ProcessDefinitionEntity : ReadOnlyEntity, IProcessDefinition
    {
        #region Constructors

        public ProcessDefinitionEntity()
        {
            DefinedProperties = new List<IPropertyMapping>();
        }

        #endregion

        #region IProcessDefinition Members

        public virtual long ProcessDefinitionId
        {
            get;
            protected set;
        }

        public virtual string Name
        {
            get;
            protected set;
        }

        public virtual string Description
        {
            get;
            protected set;
        }

        public virtual long SLA
        {
            get;
            protected set;
        }

        public virtual string WorkflowXaml
        {
            get;
            protected set;
        }

        public virtual IProcessDefinitionGroup BelongsToGroup
        {
            get;
            protected set;
        }

        #endregion

        #region AbstractEntity<TIdentity> Overrides

        public override long Id
        {
            get
            {
                return ProcessDefinitionId;
            }
            protected set
            {
                ProcessDefinitionId = value;
            }
        }

        #endregion

        #region IHasPropertyDefinitions Implementations

        public virtual IList<IPropertyMapping> DefinedProperties
        {
            get;
            protected set;
        }

        #endregion
    }
}
